Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use automatic partition_labels in new CutWire how-to #370

Merged
merged 18 commits into from
Aug 18, 2023

Conversation

garrison
Copy link
Member

This introduces a cut_wires function, as suggested at #326 (comment), which is the one remaining piece (beyond #368) that is needed to make it so wire cuts can be specified by CutWires alone, without having also to provide the correct partition_labels.

I've opened this as a PR against the branch in #368 so GitHub will show only the changes that are unique to this PR. I still think, however, that #368 should be merged first and then this should go in after it, since they are each logical, discrete changes.

@garrison garrison added documentation Improvements or additions to documentation enhancement New feature or request cutting QPD-based circuit cutting code labels Aug 17, 2023
@garrison garrison added this to the 0.3.0 milestone Aug 17, 2023
@garrison garrison requested a review from caleb-johnson August 17, 2023 02:48
caleb-johnson
caleb-johnson previously approved these changes Aug 17, 2023
Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really elegant. I like the symmetry between cut_wires and cut_gates. They both prepare a circuit for a gate cutting workflow. I like that we abstract the difference between gate and wire cutting immediately in our workflow.

Just a small, pedantic comment on imports here and also a suggestion we link to the wire-cutting-as-a-2q-IGate-cut appendix in the Piveteau/Sutter paper.

Thanks!

circuit_knitting/cutting/cut_wire_to_move.py Outdated Show resolved Hide resolved
def cut_wires(circuit: QuantumCircuit, /) -> QuantumCircuit:
"""Transform all :class:`.CutWire` instructions in a circuit to :class:`.Move` instructions marked for cutting.

The returned circuit will have one newly allocated qubit for every :class:`.CutWire` instruction.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we link to the Piveteau/Sutter LOCC wire cutting paper appendix here? THey do a nice explanation of wire cutting as a 2q identity cut / move operation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go in an explanation at some point, but good idea -- I've added it here for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I plan on making a milestone for tidying up the docs by using more links out to explanation (especially in cutting tutorials. they're very verbose.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean issue, rather than milestone? We can add such an issue to the 0.3.1 milestone.

Base automatically changed from cutwire-howto to main August 18, 2023 13:25
@garrison garrison dismissed caleb-johnson’s stale review August 18, 2023 13:25

The base branch was changed.

@github-actions
Copy link

Pull Request Test Coverage Report for Build 5903504761

  • 10 of 10 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 91.255%

Totals Coverage Status
Change from base Build 5903206201: 0.02%
Covered Lines: 2734
Relevant Lines: 2996

💛 - Coveralls

caleb-johnson
caleb-johnson previously approved these changes Aug 18, 2023
Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, outside an underscore I couldn't explain

test/cutting/test_wire_cutting_transforms.py Outdated Show resolved Hide resolved
@garrison garrison merged commit dbd778c into main Aug 18, 2023
@garrison garrison deleted the cutwire-no-partition-labels branch August 18, 2023 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename cut_wires_to_moves module to wire_cutting_transforms
2 participants